

class DownloadTask {
  final String url;
  final String localPath;
  final String md5;

  DownloadTask({
    required this.url,
    required this.localPath,
    required this.md5,
  });
}

class UpdateManifest {
  final Env env;
  final Map<String, dynamic> webapp;
  final Map<String, dynamic> appstore;

  UpdateManifest({
    required this.env,
    required this.webapp,
    required this.appstore,
  });

  factory UpdateManifest.fromJson(Map<String, dynamic> json) {
    return UpdateManifest(
      env: Env.fromJson(json['env'] as Map<String, dynamic>),
      webapp: json['webapp'] as Map<String, dynamic>,
      appstore: json['appstore'] as Map<String, dynamic>,
    );
  }
}

class Env {
  final String number;
  final String zkAddress;
  final String name;

  Env({
    required this.number,
    required this.zkAddress,
    required this.name,
  });

  factory Env.fromJson(Map<String, dynamic> json) {
    return Env(
      number: json['number'] as String,
      zkAddress: json['zkAddress'] as String,
      name: json['name'] as String,
    );
  }
}
